package com.example.brvah_test;


import android.content.Context;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import java.util.ArrayList;

/**
 * @Description
 * @Author xudan
 * @CreateTime 2024/4/21
 */
public class MyRVAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    private Context context;
    private ArrayList<String> inner_data;

    public MyRVAdapter(Context context, int layout, ArrayList<String> data, ArrayList<String> rvRvData) {
        super(layout, data);
        this.context = context;
        this.inner_data = rvRvData;
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        helper.setText(R.id.tv1, item);
        helper.setText(R.id.tv2, item);
        RecyclerView rv_rv = helper.findView(R.id.rv_rv);
        rv_rv.setLayoutManager(new LinearLayoutManager(context));
        rv_rv.setAdapter(new MyRvRvAdapter(R.layout.rv_rv_item, inner_data));
    }

}
